//
//  PIRect.m
//  iPaint
//
//  Created by Jedd Haberstro on 2/14/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "PIRect.h"


@implementation PIRect

- (id)init {
    self = [super init];
    if (self) {
		[self setStrokeColor:[NSColor blackColor]];
		[self setFillColor:[NSColor redColor]];
	}
	return self;
}

-(NSRect)rect
{
	return _rect;
}

-(void)setLocation:(NSPoint)loc
{
	_rect.origin.x = loc.x;
	_rect.origin.y = loc.y;
}

-(void)setWidth:(float)width andHeight:(float)height
{
	_rect.size.width = width;
	_rect.size.height = height;
}

-(void)setRect:(NSRect)rect
{
	_rect = rect;
}

-(void)addRectToPath
{
	[[self path] appendBezierPathWithRect:[self rect]];
}

- (void)draw
{
    [[self fillColor] set];
    NSRectFill([self rect]);
}

@end
